#include "bussiness.h"

namespace bussiness
{
    int CBussinessCache::story_dataIntoCache(const cache::CCacheData bussinessData_)
    {
        *(m_cThreadVariable.get_var()->m_pData) = bussinessData_;
        ++m_cThreadVariable.get_var()->m_iStoryTimes;

        if(bussinessData_.m_data_1 == (m_cThreadVariable.get_var()->m_pData)->m_data_1 &&
            bussinessData_.m_data_2 == (m_cThreadVariable.get_var()->m_pData)->m_data_2 &&
               bussinessData_.m_data_3 == (m_cThreadVariable.get_var()->m_pData)->m_data_3) 
            return 1;
        else return 0;   
    }

    int CBussinessCache::get_dataFromCache(cache::CCacheData &bussinessData_)
    {
        bussinessData_ = *(m_cThreadVariable.get_var()->m_pData);
        if(m_cThreadVariable.get_var()->m_iStoryTimes  >0) return 1;
        else return 0;
    }
}